#include "dag.h"
#include "dag_graph_operator.h"
#include "dag_operators.h"
#include "dag_threading.h"

#include <string>

using namespace dag;
using namespace std;

namespace {
	bool registration_complete = false;
	Mutex mutex;
}

const string OpId::pass_op("pass_op");
const string OpId::graph_op("graph_op");
const string OpId::mult_op("mult_op");
const string OpId::add_op("add_op");
const string OpId::linear_op("linear_op");
const string OpId::kd_tree_op("kd_tree_op");

void dag::register_internal_inflators() {
	ScopedLock sl(mutex);
	
	if (!registration_complete) {
		registration_complete = true;
		register_inflator(OpId::pass_op.c_str(), &PassOp::inflate);
		register_inflator(OpId::graph_op.c_str(), &GraphOperator::inflate);
		register_inflator(OpId::mult_op.c_str(), &MultOp::inflate);
		register_inflator(OpId::add_op.c_str(), &AddOp::inflate);
		register_inflator(OpId::linear_op.c_str(), &LinearOp::inflate);
		register_inflator(OpId::kd_tree_op.c_str(), &KdTreeOp::inflate);
	}
}